package utils

import (
	"github.com/danfwing/sd-project/pkg/base"
	"github.com/google/uuid"
	"time"
)

// GenerateUUID 生成UUID
func GenerateUUID() string {
	return uuid.New().String()
}

// 生成model
func NewModel(user string) *base.Model {
	return &base.Model{
		Code:      GenerateUUID(),
		Created:   time.Now().Unix(),
		Updated:   time.Now().Unix(),
		CreatedBy: user,
		UpdatedBy: user,
	}
}
